#!/usr/bin/python

import random

fp = open("2.in", "w")
fp.write("999 1998000\n")
for i in range(1, 1000):
	a = int(random.random()*998) + 1
	b = int(random.random()*998) + 1
	for j in range(0, 2000):
		fp.write("%d %d\n" % (a, b))

fp.write("0\n")
fp.close()